<template>
  <view>

  </view>
</template>

<script>
import {UniRouter} from "@/util/uniUtils";
import RouterPath from "@/constant/RouterPath";
import {postActionSimple} from "@/util/api";
import UserApi from "@/api/UserApi";

export default {
  data() {
    return {
    }
  },
  onLoad() {
    this.init()
  },
  methods: {
    async init() {
      try {

        let result = await postActionSimple(UserApi.url.tokenRefresh)
        this.$store.commit('SET_TOKEN',result)
        UniRouter.reLaunch(RouterPath.tabbar.home)
      } catch (e) {
        console.log(e)
        UniRouter.reLaunch(RouterPath.login.login)
      }
    },
  }
}
</script>

<style lang="scss" scoped>
</style>
